package com.fsu.database.dao;

import java.util.List;

/**
 * read only structure for Book information
 * @author Bonazza
 *
 */
public class Book extends Media {
	/**
	 * Book's ISBN number (exactly 9 digits)
	 */
	private String isbn;
	/**
	 * Book's subject
	 */
	private String subject;
	
	/**
	 * The book's publisher
	 */
	private Publisher publisher;
	
	/**
	 * The list of book's authors
	 */
	private List<Author> authors;
	
	/**
	 * Constructor
	 * @param title
	 * @param year
	 * @param price
	 * @param isbn
	 * @param subject
	 */
	public Book(String title, int year, float price, 
			String isbn, String subject, Publisher pub, List<Author> authors) {

		super(title, year, price);
		this.isbn = isbn;
		this.subject = subject;
		this.publisher = pub;
		this.authors = authors;
	}
	
	/** Accessor methods */
	public String getISBN() { return isbn; }
	public String getSubject() { return subject; }
	public Publisher getPublisher() { return publisher; }
	public List<Author> getAuthors() { return authors; }
	
	public String toString() {
		String str = super.toString() + "\nisbn: " + 
				isbn + "\nsubject: " + subject + 
				"\npublisher info:\n" + publisher + "\nauthor info: \n";
		
		for (Author a : authors) {
			str = str + a + "\n";
		}
		
		return str;
	}
}
